package com.xtool.livewallpaper.loop

import android.content.res.Configuration
import android.os.Bundle
import androidx.appcompat.app.AppCompatActivity
import androidx.appcompat.app.AppCompatDelegate
import androidx.appcompat.app.AppCompatDelegate.MODE_NIGHT_YES
import com.gyf.immersionbar.ImmersionBar
import com.xtool.livewallpaper.databinding.ActivityLoopWallpaperBinding

class LoopWallpaperActivity : AppCompatActivity() {
    private val binding: ActivityLoopWallpaperBinding by lazy {
        ActivityLoopWallpaperBinding.inflate(
            layoutInflater
        )
    }

    override fun onStart() {
        super.onStart()
        val uiMode = resources.configuration.uiMode
        val isNightMode = AppCompatDelegate.getDefaultNightMode() == MODE_NIGHT_YES
                || uiMode and Configuration.UI_MODE_NIGHT_MASK == Configuration.UI_MODE_NIGHT_YES
        ImmersionBar.with(this)
            .statusBarDarkFont(!isNightMode)
            .transparentStatusBar()
            .init()
    }


    override fun onCreate(savedInstanceState: Bundle?) {
        super.onCreate(savedInstanceState)
        setContentView(binding.root)
    }
}